<template>
  <div class="allContent">
    <div class="descContent">
       <div class="leftTxt" :style="{'width': styles.txtWidth}">{{styles.name}}</div>
       <div class="rightTxt">
        <span class="num">{{styles.total}}</span>
        <span class="unit">{{styles.unit}}</span>
       </div>
    </div>
    <div class="process">
      <div class="bottomContent"></div>
      <div class="topContent" :style="{'width': styles.width}"></div>
      <div class="botContent" :style="{'left': styles.left}">
        <div class="ball">
        </div>
      </div>
    </div>
  </div>
  </template>
<script>
import { computed } from 'vue'
export default {
  props: {
    rate: {
      type: Number,
      default: 50
    },
    total: {
      type: Number,
      default: 50
    },
    name: {
      type: String,
      default: '道路普通货物运输'
    },
    unit: {
      type: String,
      default: '辆'
    },
    width: {
      type: String,
      default: '327px'
    }
  },
  setup(props, context) {
    const styles = computed(() => {
      return {
        left: (props.rate - 2) + '%',
        width: (props.rate) + '%',
        name: props.name,
        total: props.total,
        unit: props.unit,
        txtWidth: props.width
      }
    })
    return {
      styles
    }
  }
}
</script>
<style lang="less">
  .allContent{
    width: 100%;
  }
  .descContent{
    width: 100%;
    height: 120px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    .leftTxt{
      height: 49.33px;
      font-family: SourceHanSansCN-Normal;
      font-size: 40px;
      font-weight: 350;
      line-height: 49.33px;
      letter-spacing: 0px;
      color: #A3A5A6;
      z-index: 0
    }
    .rightTxt{
      .num{
        font-family: SourceHanSansCN-Regular;
        font-size: 60px;
        font-weight: normal;
        line-height: 48.19px;
        letter-spacing: 0px;
        color: #E6F7FF;
        z-index: 1;
        width: 200px;
      }
      .unit{
        display: inline-block;
        width: 70px;
        font-family: SourceHanSansCN-Normal;
        font-size: 40px;
        font-weight: 350;
        line-height: 49.33px;
        text-align: right;
        letter-spacing: 0px;
        color: #A3A5A6;
        z-index: 2
      }
    }
  }
  .process {
      width: 100%;
      height: 40px;
      // background: #ffffff;
      position: relative;
      .bottomContent{
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 15px;
        background: rgba(112, 112, 112, 0.5);
        z-index: 1;
      }
      .topContent{
        position: absolute;
        left: 0;
        top: 0;
        height: 15px;
        background: linear-gradient(270deg, #1B7EF2 0%, rgba(112,112,112,0.23) 99%);
        z-index: 2;
      }
      .botContent{
        border-radius: 50%;
        position: absolute;
        top: -17px;
        width: 47px;
        height: 47px;
        background: rgba(22, 22, 22, 0);
        border: 3px solid rgba(65, 222, 255, 0.48);
        filter: blur(2px);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 3;
        .ball{
          border-radius: 50%;
          width: 19px;
          height: 19px;
          width: 19px;
          height: 19px;
          background: radial-gradient(50% 50% at 50% 50%, #ECFDFF 9%, #41DEFF 100%);
          box-shadow: 0px 0px 15.78px 12px rgba(0, 174, 255, 0.44);
        }
      }
  }
</style>
